<?php

/**
 * 产品价格仓库
 * @author wangwx 2015-5-12
 */
namespace common\repositories\myhtsq;
use common\repositories\BaseRepository;
use common\support\StringHelper;
use common\entities\myhtsq\ApplicationPriceEntity;
class ApplicationPriceRepository extends BaseRepository{

	/**
	 * 构造方法
	 * @param unknown $config (optional)
	 */
	public function __construct($config = [])
	{
		parent::__construct($config);
	}
	
	/**
	 * 根据产品id,获取产品价格列表
	 * @param string $applicationId 产品id
	 * @return array
	 */
	public static function getAllApplicationPriceByApplicationId($applicationId){
		return ApplicationPriceEntity::find()->where(['application_id'=>$applicationId])->asArray()->all();
	}

    /**
     * 根据产品id,获取产品价格列表
     * @param string $applicationId 产品id
     * @return array
     */
    public static function getApplicationPriceByApplicationId($applicationId){
        return ApplicationPriceEntity::find()->where(['application_id'=>$applicationId])->asArray()->one();
    }
	
	
}